package com.yxym.interface_;

public class ExtendsVsInterface {
    public static void main(String[] args) {
        SmallMonkey smallMonkey = new SmallMonkey("吉吉国王");
        smallMonkey.Study();
        smallMonkey.Fly();
        smallMonkey.climbing();
    }
}

class Monkey{
    private String name;

    public Monkey(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void  climbing(){
        System.out.println(getName() + "会爬树...");
    }

}

interface Fish{
    void Study();
}

interface Bird{
    void Fly();
}
class SmallMonkey extends Monkey implements Fish ,Bird{
    public SmallMonkey(String name) {
        super(name);
    }

    @Override
    public void Study() {
        System.out.println(getName() + "爱学习...");
    }

    @Override
    public void Fly() {
        System.out.println(getName() +"会飞翔...");
    }
}